package com.itheima.hashset;

import java.util.HashSet;
import java.util.Iterator;

public class HashSetDemo1 {
    public static void main(String[] args) {
        HashSet<Student> hashSet=new HashSet<>();
        hashSet.add(new Student("yyds","22"));
        hashSet.add(new Student("yy","23"));
        hashSet.add(new Student("yyds","22"));
        hashSet.add(new Student("yyd","26"));
        hashSet.add(new Student("yyd","11"));
        hashSet.add(new Student("yyd","9"));
        Iterator<Student> iterator=hashSet.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
